package br.consultorio.digital.control;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.ImageButton;
import br.consultorio.digital.R;

/**
 * 
 * @author Paulo
 * 
 */
public class MainController extends Activity implements OnClickListener {

	/** Called when the activity is first created. */
	private ImageButton btagenda;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.main);

		btagenda = (ImageButton) findViewById(R.idMain.btBuscarAgenda);
		btagenda.setOnClickListener(this);
	}

	public void onClick(View v) {

		switch (v.getId()) {
		case R.idMain.btBuscarAgenda:
			abrirTela(AgendaMenu.class);
		}
	}

	/**
	 * Abre a tela.
	 */
	private void abrirTela(Class<?> c) {
		Intent it = new Intent(this, c);
		startActivity(it);
	}
}